{template 'common/header'}
<ul class="nav nav-tabs">
	<li class="active"><a href="{php echo $this->createWebUrl('order')}">订单列表</a></li>
</ul>
{if $op == 'display'}
<style>
th{
	text-align: center !important;
}
td{
	text-align: center !important;
	white-space: normal !important;
	word-break: break-all !important;
}
</style>
<form action="" method="get" class="form-horizontal" role="form">
<div class="panel panel-info">
        <div class="panel-heading">筛选</div>
        <div class="panel-body">
                <input type="hidden" name="c" value="site" />
                <input type="hidden" name="a" value="entry" />
                <input type="hidden" name="m" value="junsion_challeng" />
                <input type="hidden" name="do" value="order" />
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">会员信息</label>
                    <div class="col-xs-12 col-sm-2 col-lg-2">
                        <input class="form-control" name="m_kwd" type="text" value="{$_GPC['m_kwd']}" placeholder="请输入会员昵称">
                    </div>
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">状态</label>
				    <div class="col-xs-12 col-sm-2 col-lg-2">
				        <select class="form-control" style="margin-right:15px;" name="status">
				            <option value="">全部</option>
				            <option value="0" {if empty($_GPC['status']) && $_GPC['status']!=''} selected="selected"{/if}>待支付</option>
				            <option value="1" {if 1 == $_GPC['status']} selected="selected"{/if}>已支付</option>
				        </select>
				    </div>
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">支付方式</label>
				    <div class="col-xs-12 col-sm-2 col-lg-2">
				        <select class="form-control" style="margin-right:15px;" name="paytype">
				            <option value="">全部</option>
				            <option value="0" {if empty($_GPC['paytype']) && $_GPC['paytype']!=''} selected="selected"{/if}>余额支付</option>
				            <option value="1" {if 1 == $_GPC['paytype']} selected="selected"{/if}>微信支付</option>
				        </select>
				    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label">时间</label>
                    <div class="col-xs-12 col-sm-3 col-lg-3">
                        {php echo tpl_form_field_daterange('dateline',array('start'=>date('Y-m-d H:i',$start),'end'=>date('Y-m-d H:i',$end)),true);}
                    </div> 
                    <div class=" col-xs-12 col-sm-1 col-lg-1">
                        <button class="btn btn-default" ><i class="fa fa-search"></i> 搜索</button>
                        <!-- <button class="btn btn-primary" name='export' value='1' >导出</button> -->
                   	</div>
                </div>
        </div>
    </div>
</form>

<div class="panel panel-default">
<div class="panel-heading">订单总数：{$total1}；订单总金额：￥{$money1}；筛选总数：{$total}；筛选金额：￥{$money}；</div>
    <div class="table-responsive panel-body">
        <table class="table table-hover">
            <thead class="navbar-inner">
            <tr>
            	<th>订单号</th>
            	<th>会员信息</th>
            	<th>次数</th>
                <th>支付方式</th>
                <th>金额<br/>状态</th>
                <th>时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody id="order-list">
            {loop $list $item}
            <tr>
            	<td>{$item['orderno']}</td>
            	<td><img src="{$mems[$item['mid']]['avatar']}" style="width:60px;"><br/>{$mems[$item['mid']]['nickname']}</td>
               	<td>{$item['num']}</td>
               	<td>
               		{if $item['paytype']==1}<label class="label label-success">微信支付</label>{/if}
               	</td>
               	<td>
                	{$item['price']}<br/>
               		{if $item['status'] == 0}
	               <label class="label label-default">待支付</label>
	               {else}
		               <label class="label label-success">已支付</label>
		               <br/>{$item['transid']}
	               {/if}
              	</td>
               	<td>{php echo date('Y-m-d H:i',$item['createtime']);}</td>
               <td>
                   <a class="btn btn-danger btn-sm" onclick="return confirm('确认删除吗？');return false;" href="{php echo $this->createWebUrl('order', array('op' => 'del', 'id' => $item['id']))}">删除</a>
                </td>
            </tr>
            {/loop}
            </tbody>
        </table>
        {$pager}
    </div>
</div>
{/if}
